.block {
  width: 200px;
  height: 200px;
  background: #f40;
  transition: all 0.3s ease-in;
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 1050;
}
.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.hide {
  opacity: 0;
  transform: translate(-50%, -100%);
}
